package integral

import (
	"net/http"

	"mall/common/resultx"
	"mall/service/forum/api/internal/handler/util"
	"mall/service/forum/api/internal/logic/forum/integral"
	"mall/service/forum/api/internal/svc"
	"mall/service/forum/api/internal/types"
)

// 获取用户今日可获取积分
func TodayRemainingIntegralHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		//var req types.IntegralExchangeProductLogListReq
		//if err := httpx.Parse(r, &req); err != nil {
		//	resultx.ParamErrorResult(r, w, err)
		//	return
		//}

		l := integral.NewTodayRemainingIntegralLogic(r.Context(), svcCtx)
		var headers []*types.Header
		resp, err := l.TodayRemainingIntegral()
		w = util.SetHeaders(w, headers)
		resultx.HttpResult(r, w, resp, err)
	}
}
